package com.aiju.bean;

import java.io.Serializable;

/**
 * @author: 佐为
 * @date: 2016-11-23 16:55
 * @version: V1.0
 * @Description: 用户
 */
public class User implements Serializable {

    private String id;          //用户id
    private String userName;    //用户名
    private String phone;       //用户手机
    private String email;       //用户email
    private String password;    //用户密码
    private Shop shop;          //用户店铺

    private String shopId;      //用户店铺id
    private String storeId;     //店铺id
    private String role;        //用户角色 1：店主 2：店员 0:总店长
    private String operatorId;  //操作员编号
    private String createDate;  //用户创建时间
    private String modifyDate;  //用户修改时间
    private String token;       //用户登录令牌

    private String shopImageUrl;    //主店铺url
    private String shopName;        //主店铺名字

    public String getShopImageUrl() {
        return shopImageUrl;
    }

    public void setShopImageUrl(String shopImageUrl) {
        this.shopImageUrl = shopImageUrl;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public boolean isHavaDirectSales() {
        return isHavaDirectSales;
    }

    public void setHavaDirectSales(boolean havaDirectSales) {
        isHavaDirectSales = havaDirectSales;
    }

    private boolean isHavaDirectSales; //子店铺里是否含有直营单


    private int sonShopNum;//子店铺

    private String oldStoreId;
    private String shareStatus;
    private String parentStoreId; //主店铺id
    private String creator;
    private String creatorPhone;
    private String isActivate;
    private String isDelete;

    public int getSonShopNum() {
        return sonShopNum;
    }

    public void setSonShopNum(int sonShopNum) {
        this.sonShopNum = sonShopNum;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getCreatorPhone() {
        return creatorPhone;
    }

    public void setCreatorPhone(String creatorPhone) {
        this.creatorPhone = creatorPhone;
    }

    public String getIsActivate() {
        return isActivate;
    }

    public void setIsActivate(String isActivate) {
        this.isActivate = isActivate;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public String getOldStoreId() {
        return oldStoreId;
    }

    public void setOldStoreId(String oldStoreId) {
        this.oldStoreId = oldStoreId;
    }

    public String getShareStatus() {
        return shareStatus;
    }

    public void setShareStatus(String shareStatus) {
        this.shareStatus = shareStatus;
    }

    public String getParentStoreId() {
        return parentStoreId;
    }

    public void setParentStoreId(String parentStoreId) {
        this.parentStoreId = parentStoreId;
    }

    public MPoints getMPoints() {
        return shop == null ? null : shop.getmPoints();
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public boolean isAdmin() {
        return !role.equals("2");
    }

    public String getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(String modifyDate) {
        this.modifyDate = modifyDate;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRole() {
        return role;
    }

    public String getRoleString() {
        if (role.equals("0")) {
            return "总店长";
        } else if (role.equals("1")) {
            return "店长";
        } else {
            return "店员";
        }

    }

    public void setRole(String role) {
        this.role = role;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

}
